﻿using System;
using System.Collections.Generic;
using DIBestPractice.Domain;
using DIBestPractice.Repository;

namespace DIBestPractice.ApplicationService
{
    public class UserApplicationService : IUserApplicationService
    {
        private readonly IUserRepository _userRepository;

        public UserApplicationService(IUserRepository userRepository)
        {
            _userRepository = userRepository;
        }

        public void Register(User user)
        {
            _userRepository.Save(user);
        }

        public User GetUser(Guid id)
        {
            return _userRepository.Get(id);
        }

        public void Remove(Guid id)
        {
            _userRepository.Remove(id);
        }

        public List<User> GetAllUsers()
        {
            return _userRepository.GetAll();
        }
    }
}